﻿/*
 *  Author David 2012-9-13 10:20
 *  业务逻辑检查正常
 * 
 * **/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace benefit.Controllers
{
    public class OperatorRealtimeTransactionController : System.Web.Mvc.Controller
    {
        public ActionResult Index(int uid, string pdate)
        {
            Benefit.DB.DBManager db = new Benefit.DB.DBManager();
            Benefit.Interface.Sys.IVisitPrower IVisitPrower = new Benefit.Service.Sys.ServiceVisitPrower(db);
            Common.Web.Cookie cookie = new Common.Web.Cookie();
            int operId = Convert.ToInt32(cookie.GetCookie("LoginUserId"));
            if (IVisitPrower.HasOperatorPrower(operId, uid))
            {
                Benefit.ViewModel.Day.OperatorRealtimeTransaction model = new Benefit.ViewModel.Day.OperatorRealtimeTransaction(uid, pdate, db);
                db.Dispose();
                return View(model);
            }
            else
            {
                db.Dispose();
                return Redirect("/Error/HasNoPrower/" + uid + "/" + pdate);
            }
        }

    }
}
